package com.walterlife.javacore;

/**
 * ClassLoaderTest
 *
 * @author zhuyuwei
 * @date 2017/5/18
 */
public class ClassLoaderTest {
    public static void loadClass() throws ClassNotFoundException {
        Class<?> clazz = Class.forName("walterlife.javacore.GCTest");
        ClassLoader classLoader = clazz.getClassLoader();
        System.out.println(classLoader.getClass().getName());
        System.out.println(classLoader.getParent().getClass().getName());
        System.out.println(classLoader.getParent().getParent());
    }

    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
//        loadClass();
        MyClassLoader myClassLoader = new MyClassLoader();
        myClassLoader.loadClass("java.langtest.MathTest");
    }
}
